/*
 *
A(int)
B(int)
C(int)
D(int)
24
100
200

 */

#include <iostream>
using namespace std;
class A{
	protected:
		int m_data;
	public:
		A(int data){
			m_data = data;
			cout << "A(int)" << endl;
		}
};
class B: virtual public A{
	public:
		B(int data):A(data){
			cout << "B(int)" << endl;
		}
		void set(int data){
			m_data = data;
		}
};
class C: virtual public A{
	public:
		C(int data):A(data){
			cout << "C(int)" << endl;
		}
		int get(void){
			return m_data;
		}
};
class D: public B, public C{
	public:
		D(int data): B(data), C(data), A(data){
			cout << "D(int)" << endl;
		}
};
int main(void){
	D d(100);
	cout << sizeof(d) << endl;
	cout << d.get() << endl; // 100
	d.set(200);
	cout << d.get() << endl; //200
	return 0;
}
